<div class="bs-callout bs-callout-info">
    <h4>Questions</h4>
    <p><a href="<?php echo base_url()?>admin/question/add">+ Add new question</a></p>
</div>

<form>
    <select class="form-control" name="list" onchange ="changeComobox(this.value)" style="width: 200px;">
        <option value="1" <?php if($op==1) echo 'selected';?>>All question</option>
        <option value="0" <?php if($op==0) echo 'selected';?>>No answer</option>            
    </select>
    <br />
</form>

<table class="table table-hover table-bordered">
    <thead>
        <tr>
            <th width="5%">#</th>
            <th width="50%">Title</th>
            <th width="15%">Aks</th>
            <th width="15%">Answer</th>
            <th width="15%">Actions</th>
        </tr>
    </thead>
    <tbody>
        <?php
        if(isset($data) && !empty($data)){
            foreach($data as $key=>$value){
        ?>
        <tr>
            <td><?php echo $value['id']; ?></td>
            <td><?php echo $value['title']; ?></td>
            <td><?php echo $value['accountid']; ?></td>
            <td><?php echo $value['answerid']; ?></td>
            <td>
                <a href="<?php echo base_url()?>admin/question/edit/<?php echo $value['id']; ?>">Edit</a>
                <a rel="<?php echo base_url()?>admin/question/delete/<?php echo $value['id']; ?>" href="#" class="confirmDelete">Delete</a>
            </td>
        </tr>
        <?php }} ?>
    </tbody>
</table>

<script type="text/javascript">
function changeComobox(val) {
    window.location.href='<?php echo base_url()."admin/question/index/";?>'+ val;
}
</script>